package com.cskaoyan.controller.user;

import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.bean.vo.statistics.StatVo;
import com.cskaoyan.service.user.UserStatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author jzp
 * @since 2022/11/20 18:39
 */

@RestController
@RequestMapping("admin/stat/")
public class UserStatController {
    @Autowired
    UserStatService userStatService;

    @RequestMapping("user")
    public BaseRespVo userStatistics() {
        StatVo userStatVo = userStatService.userStatistics();
        return BaseRespVo.succeed(userStatVo);
    }

    @RequestMapping("order")
    public BaseRespVo orderStatistics() {
        StatVo orderStatVo = userStatService.orderStatistics();
        return BaseRespVo.succeed(orderStatVo);
    }

    @RequestMapping("goods")
    public BaseRespVo goodsStatistics() {
        StatVo goodsStatVo = userStatService.goodsStatistics();
        return BaseRespVo.succeed(goodsStatVo);
    }
}
